package com.lizx.admin.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lizx.admin.mapper.ExpenditureMapper;
import com.lizx.admin.service.ExpenditureService;
import com.lizx.pojo.Expenditure;
import com.lizx.pojo.vo.ExpenditureStatistics;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
* @author lizexing
* @description 针对表【tb_expenditure】的数据库操作Service实现
* @createDate 2024-04-29 10:31:37
*/
@Service
public class ExpenditureServiceImpl extends ServiceImpl<ExpenditureMapper, Expenditure>
    implements ExpenditureService {

    @Resource
    ExpenditureMapper expenditureMapper;

    @Override
    public List<ExpenditureStatistics> statisticsList(String areaName, Integer archId) {
//        int year = searchDate.getYear()+1900;
//        int month = searchDate.getMonth()+1;
//        return expenditureMapper.statisticsList(year,month,areaName);
        return expenditureMapper.statisticsList(areaName,archId);
    }

    @Override
    public List<Expenditure> detail(Integer start, int end, Integer aid, Date times, String employeeName, String projectName, Integer archiving) {
        int year = times.getYear()+1900;
        int month = times.getMonth()+1;
        return expenditureMapper.detail(start,end,aid,year,month,employeeName,projectName,archiving);
    }

    @Override
    public List<Expenditure> detailList(Integer aid, Date times, String employeeName, String projectName) {
        int year = times.getYear()+1900;
        int month = times.getMonth()+1;
        return expenditureMapper.detailList(aid,year,month,employeeName,projectName);
    }

    @Override
    public Integer sumTotalFee(Date starDate, Date endDate, int status) {
        return expenditureMapper.sumTotalFee(starDate,endDate,status);
    }
}




